<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>promise的执行时序</div>
    <script>
      console.log("global start");

      setTimeout(() => {
        console.log("setTimeout");
      }, 0);
      Promise.resolve()
        .then(() => {
          console.log("promise");
        })
        .then(() => {
          console.log("promise2");
        })
        .then(() => {
          console.log("promise3");
        });
      console.log("global end");
      //global start
      //global end
      //promise
      //promise2
      //promise3
      //setTimeout
    </script>
  </body>
</html>
